<?php

class Test_Storage_Local {
    
    private $_storage = null;
    
    public function __construct() {
        
        $this->_storage = Storage::factory('Local', array(
            'base_url' => 'https://test.domain.com/tmp',
            'base_path' => APP_PATH . '/tmp',
        ));
    }
    
    /**
     * 测试读写
     */
    public function testWriteRead() {
        
        $path = 'test/test1.txt';
        $content = 'this is a test';
        $this->_storage->write($path, $content);
        echo 'content: ', $this->_storage->read($path), PHP_EOL;
        echo 'url: ', $this->_storage->getUrl($path), PHP_EOL;
        $this->_storage->remove($path);
        return true;
    }
}